<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AlterItemOrderTableAddIsCommissionInitField extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('item_orders', function (Blueprint $table) {
            $table->tinyInteger('is_commission_init')->default(0)->comment('佣金是否初始化')->after('money');
            $table->tinyInteger('is_commission_strike')->default(0)->comment('佣金是否已结算')->after('is_commission_init');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('item_orders', function (Blueprint $table) {
            $table->dropColumn(['is_commission_init', 'is_commission_strike']);
        });
    }
}
